package MLlib

import java.util

import com.hankcs.hanlp.HanLP
import com.hankcs.hanlp.dictionary.py.Pinyin
import com.hankcs.hanlp.seg.common.Term

/**
 * 中文分词工具包
 */
object HanLPDemo {
  def main(args: Array[String]): Unit = {
    val s: String = "我有一头小毛驴我从来也不骑，有一天我心血来潮骑它去赶集..."
    val terms: util.List[Term] = HanLP.segment(s)
    import scala.collection.JavaConversions._
    terms.foreach(println)
    val pinyins: util.List[Pinyin] = HanLP.convertToPinyinList(s)
    pinyins.foreach(println)


  }
}
